TeamsDR-Add Customer with existing ITSP

The TeamsDR-Add Customer with existing ITSP script is triggered during the Onboarding wizard. It applies the following configuration on the SBC device that is configured to connect calls to the customer site location:

Configures a new IP Group for the Carrier leg for each new site location (indicated on SBC by <name>-c):
Configures customer name based on the Customer Short Name.
Configures a new Proxy Set and IP Profile based on the Carrier value configured in the Onboarding wizard. For example, Proxy_Set, SIP Trunk.
Configures 'Tags' parameter in IP Group based on the customer sub domain name. For example 'Trunk=BradDRService.sandbox2.audiocodes.be'.
Disables classification by Proxy Set.
Applies Call Setup Rules Set ID 1 for Carrier IP Group (see details in table below).
Configures a new IP Group for the Teams leg for each new site location (indicated on SBC by <name>-t):
Configures customer name based on the Customer Short Name.
Configures a new Proxy Set 'Teams' and new IP Profile 'Teams'
Configures 'Local Host Name' based on the customer sub domain name. For example, 'BradDRService.sandbox2.audiocodes.be'.
Enables 'Always Use Src Address' which enables the device to always send SIP requests and responses, within a SIP dialog, to the source IP address received in the previous SIP message packet.
Configures 'Tags' parameter in IP Group based on the customer sub domain name. For example 'Tenant=BradDRService.sandbox2.audiocodes.be'
Disables Classification by Proxy Set.
Applies the Call Setup Rules Set ID 0 for Teams IP Group (see details in table below).
If CAC is enabled in the Onboarding wizard, configures the selected CAC Profile and enables CAC.
If Carrier registration is enabled in the Onboarding wizard, a SIP Registration account is configured on the SBC with the following (wizard configured parameters are indicated in parenthesis):
account-name (Customer ShortName)
served-ip-group-name (Teams IP Group Name)
serving-ip-group-name (Carrier IP Group Name)
user-name (Carrier User Name)
password (Carrier Password)
host-name (Carrier Host Name)
contact-user (Carrier Main Line)

The table below summarizes the Call Setup Rules called by this script.

Index

Rules Set ID

Name

Request Type

Request Target

Request Key

Condition

Action Subject

Action Type

Action Value

1

0

-

Dial Plan

CustDialPlan

Param.Call.Src.User

DialPlan.Found exists

DstTags.Trunk

Modify

DialPlan.Result

2

0

-

Dial Plan

CustDialPlan

Header.P-Asserted-Identity.URL.User

DialPlan.Found exists

DstTags.Trunk

Modify

DialPlan.Result

3

0

-

None

-

-

var.session.0 == ''

var.session.0

Modify

Param.IPG.Src.Tags.Tenant

4

0

-

None

-

-

-

SrcTags.Source

Modify

'Teams'

5

1

-

Dial Plan

CustDialPlan

Param.Call.Dst.User

var.session.0 == ''

var.session.0

Modify

DialPlan.Result

6

1

-

-

 

 

var.session.0 != ''

DstTags.Tenant

Modify

Var.Session.0

7

1

-

None

-

-

-

SrcTags.Source

Modify

'SIPTrunk'

Copy
    ### Script Version 1.0 ###
# Adding a New Customer with existing Carrier
# Id: 5461233
# 

configure voip
 ip-group new
  name "{{CustomerId}}-c"
  proxy-set-name "{{SBC.CarrierID}}"
  ip-profile-name "{{SBC.CarrierID}}"
  srd-name "DefaultSRD"
  tags "Trunk={{SBC.OnlinePstnGateway}}"
  classify-by-proxy-set disable
  outbound-mesg-manipulation-set 3
  call-setup-rules-set-id 1 
  activate
 exit
 ip-group new 
  name "{{CustomerId}}-t"
  proxy-set-name "Teams"
  ip-profile-name "Teams"
  srd-name "DefaultSRD"
  local-host-name "{{SBC.OnlinePstnGateway}}" 
  always-use-source-addr enable 
  tags "Tenant={{SBC.OnlinePstnGateway}}" 
  classify-by-proxy-set disable 
  call-setup-rules-set-id 0
  {{#if  SBC.EnableCAC}}    
   cac-profile "{{SBC.CacProfile}}"
  {{/if }}  
  activate 
 exit

 {{#if  SBC.FlagCarrierRegistration}}
  sip-definition account new
   account-name "{{CustomerId}}"
   served-ip-group-name "{{CustomerId}}-c"
   serving-ip-group-name "{{CustomerId}}-c"
   user-name "{{SBC.CarrierUserName}}"
   password "{{SBC.CarrierPassword}}"
   host-name "{{SBC.CarrierHostName}}"
   contact-user "{{SBC.CarrierMainLine}}"
   register reg
   application-type sbc
   activate
  exit
  ip-group where name "{{CustomerId}}-c"
   authentication-mode sbc-as-client
   username-as-client "{{SBC.CarrierUserName}}"
   password-as-client "{{SBC.CarrierPassword}}"
   activate
  exit
 {{/if }} 

 {{#each SBC.DialPlanPrefixes}}
  sbc dial-plan where name "{{this.DialPlanName}}"
  {{#each this.Rules}}
   dial-plan-rule new
    name "{{this.Name}}"
    prefix "{{this.Prefix}}"
    tag "{{this.Tag}}"
   exit
  {{/each}}
  activate 
  exit
 {{/each}}
do write